from concurrent.futures import ThreadPoolExecutor
import requests
import uuid
import json
import sys
import os

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

from model.car_number import CarNumber

from common.logger import logger
from spider.etcp_park import EtcpParkSpider

import spider_config

import threading

def test(carNumber: CarNumber):
    try:
        spider = EtcpParkSpider()
        spider.setProxy(None)
        spider.query(carNumber)
    except Exception as e:
        logger.exception(e)


if __name__ == "__main__":
    thread_count = 10
    
    cars = [
        "桂B47H88",
        "桂A5AV15",
        "桂C3H503",
        "桂B6362W",
        "桂BM8734",
        "粤KYX283",
        "川C356F3",
        "桂JJP003",
        "苏E76VL3",
    ]
    
    for car in cars:
        test(CarNumber(car))
